package MethodOverriding;

public class Foreigner extends Person{

    public void introduce(){
        System.out.println("I'm foreigner");
    }

    public void lunch(){
        this.introduce();
        //this：从本类成员开始往上找
        this.eat();
        this.drink();
        //从父类成员开始往上找(未被重写)
        System.out.println("等我在中国住上十年");
        super.eat();
        super.drink();
    }

    //父类方法不满足子类需求，需要把这个方法重写
    @Override
    public void eat(){
        System.out.println("吃意面");
    }

    @Override
    public void drink(){
        System.out.println("喝凉水");
    }
}
